<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/4/23
 * Time: 15:19
 */

namespace app\logic\index\model;


use app\logic\BaseLogic;
use app\model\image\ImageCommandPlanModel;

class ImageModelLogic extends BaseLogic
{
    protected $model;

    protected static $instance;

    public function __construct()
    {
        parent::__construct();
        $this->model = \app\model\image\ImageModelModel::getInstance();
    }

    public static function getInstance()
    {
//        if(is_object(self::$instance)){
//            return self::$instance;
//        }

        return  new self();
    }

    public function getList($param)
    {
        $where = [
            'isdel'=>0,
            'status'=>1,
        ];
        $fields = ['id','name','image'];

        $list =  $this->model->index($where,$fields,['id','desc']);

        return $list;
    }

    public function getImageModelList($param)
    {
        $where = [
            'isdel'=>0,
            'status'=>1,
        ];
        $fields = ['id','name','image'];

        $list = ImageCommandPlanModel::getInstance()->index($where,$fields,['sort','desc']);

        return $list;
    }
}